﻿using System.Collections;

namespace Klear.Library.Models;
using SQLite;

[Table("budget")]
public class BudgetModel : ICloneable
{
    [PrimaryKey, AutoIncrement]
    public int ID { get; set; }
    
    [Column("budget") , NotNull] 
    public decimal Budget { get; set; } 
    [Column("startdate") , NotNull] 
    public DateTime StartDate { get; set; }
    
    [Column("enddate") , NotNull] 
    public DateTime EndDate { get; set; } 
    
    [Column("warningthreshold") , NotNull] 
    public decimal WarningThreshold { get; set; }

    public bool IsWarningEnabled; //是否过预警值

    public Task<decimal> ActualAmount;

    public object Clone()
    {
        return new BudgetModel
        {
            Budget = this.Budget,
            StartDate = this.StartDate,
            EndDate = this.EndDate,
            WarningThreshold = this.WarningThreshold,
            IsWarningEnabled = this.IsWarningEnabled,
            ActualAmount = this.ActualAmount
        };
    }
}